#pragma once
#include "..\..\EdgeMath\Vectors.h"
#include "..\..\EdgeGraphics\ConstantBuffer.h"
#include "..\..\EdgeGameCore\BaseGameComponent.h"
#include "../../Shaders/Defs/ConstantBuffers.hlsli"

class StateMachine;
class Chunk;
class Skybox;

// Controls the behavior of chunks: which and when chunks(s) should currently 
// be loaded as well as unloaded. In addition, generates new chunks as they are needed
class ChunkManager : public BaseGameComponent
{
	StateMachine* chunks = nullptr;

	Skybox* skybox;
	static ChunkManager* instance;

	ChunkManager(void);
	virtual ~ChunkManager(void);
public:	

	// implament virtual members
	virtual void Update(float dt) override;

	virtual void Draw(void) override;

	Chunk* getActiveChunk(void) const;

	static void Init(void) { instance = new ChunkManager; }
	static void Shutdown(void) 
	{ 
		delete instance;
	}

	static ChunkManager* GetInstance(void) { return instance; }
};